import Mock from "mockjs2";
import { builder } from "../util";

const getUserInfo = () => {
  return builder({
    id: 5,
    nickname: "17339612793", //昵称
    price: "0.00", //金额
    img: "", //头像
    team_name: "团队1", //团队名称
    UserApplyGoods: {
      //用户申请推广商品的数量
      num: 2
    },
    UserBindGoods: {
      // 用户正在推广的商品数量
      num: 1
    }
  });
};

const getUserGoods = () => {
  return builder([
    {
      id: 15, // 商品id
      goods_url: require("@/assets/images/goodsimg.jpg"),
      goods_short_title: "女帽", //商品短标题
      commission_than: "10", //佣金比例
      start_time: "2020-05-02 15:26:20", //开始时间
      goods_end_time: "2020-05-09 15:26:20", //结束时间
      shop_deposit: "100.00", //店铺押金
      goods_activity: 1,
      goods_class_name: "女装", // 分类名称
      coupon_type: 1,
      coupon_price: "20", //优惠卷金额
      goods_status: "1", // 商品状态1=正常 2=佣金变动 3=到期结束 3= 系统下架 4=主动下架
      coupon_collar_count: 100, //优惠卷领取数量
      coupon_num: 10000, //优惠卷数量
      after_coupon_price: "40.00", // 卷后单价
      goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
      goods_price: "30.00", //商品单价
      copywriting: "推广文案" // 推广文案
    },
    {
      id: 14, // 商品id
      goods_url: require("@/assets/images/goodsimg.jpg"),
      goods_short_title: "女帽", //商品短标题
      commission_than: "10", //佣金比例
      start_time: "2020-05-02 15:26:20", //开始时间
      goods_end_time: "2020-05-09 15:26:20", //结束时间
      shop_deposit: "100.00", //店铺押金
      goods_activity: 1,
      goods_class_name: "女装", // 分类名称
      coupon_type: 1,
      coupon_price: "20", //优惠卷金额
      goods_status: "2", // 商品状态1=正常 2=佣金变动 3=到期结束 3= 系统下架 4=主动下架
      coupon_collar_count: 100, //优惠卷领取数量
      coupon_num: 10000, //优惠卷数量
      after_coupon_price: "40.00", // 卷后单价
      goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
      goods_price: "30.00", //商品单价
      copywriting: "推广文案" // 推广文案
    },
    {
      id: 10, // 商品id
      goods_url: require("@/assets/images/goodsimg.jpg"),
      goods_short_title: "女帽", //商品短标题
      commission_than: "10", //佣金比例
      start_time: "2020-05-02 15:26:20", //开始时间
      goods_end_time: "2020-05-09 15:26:20", //结束时间
      shop_deposit: "100.00", //店铺押金
      goods_activity: 1,
      goods_class_name: "女装", // 分类名称
      coupon_type: 1,
      coupon_price: "20", //优惠卷金额
      goods_status: "3", // 商品状态1=正常 2=佣金变动 3=到期结束 3= 系统下架 4=主动下架
      coupon_collar_count: 100, //优惠卷领取数量
      coupon_num: 10000, //优惠卷数量
      after_coupon_price: "40.00", // 卷后单价
      goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
      goods_price: "30.00", //商品单价
      copywriting: "推广文案" // 推广文案
    },
    {
      id: 13, // 商品id
      goods_url: require("@/assets/images/goodsimg.jpg"),
      goods_short_title: "女帽", //商品短标题
      commission_than: "10", //佣金比例
      start_time: "2020-05-02 15:26:20", //开始时间
      goods_end_time: "2020-05-09 15:26:20", //结束时间
      shop_deposit: "100.00", //店铺押金
      goods_activity: 1,
      goods_class_name: "女装", // 分类名称
      coupon_type: 1,
      coupon_price: "20", //优惠卷金额
      goods_status: "4", // 商品状态1=正常 2=佣金变动 3=到期结束 3= 系统下架 4=主动下架
      coupon_collar_count: 100, //优惠卷领取数量
      coupon_num: 10000, //优惠卷数量
      after_coupon_price: "40.00", // 卷后单价
      goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
      goods_price: "30.00", //商品单价
      copywriting: "推广文案" // 推广文案
    },
    {
      id: 16, // 商品id
      goods_url: require("@/assets/images/goodsimg.jpg"),
      goods_short_title: "女帽", //商品短标题
      commission_than: "10", //佣金比例
      start_time: "2020-05-02 15:26:20", //开始时间
      goods_end_time: "2020-05-09 15:26:20", //结束时间
      shop_deposit: "100.00", //店铺押金
      goods_activity: 1,
      goods_class_name: "女装", // 分类名称
      coupon_type: 1,
      coupon_price: "20", //优惠卷金额
      goods_status: "5", // 商品状态1=正常 2=佣金变动 3=到期结束 3= 系统下架 4=主动下架
      coupon_collar_count: 100, //优惠卷领取数量
      coupon_num: 10000, //优惠卷数量
      after_coupon_price: "40.00", // 卷后单价
      goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
      goods_price: "30.00", //商品单价
      copywriting: "推广文案" // 推广文案
    }
  ]);
};
const doEditInfo = () => {
  return builder({
    code: 200,
    msg: "修改成功",
    data: []
  });
};

const getAdminGoods = () => {
  return builder({
    page: 1,
    max_page: 1,
    count: 2,
    data: [
      {
        id: 6, // 商品表自增id
        goods_url:
          "https://detail.tmall.com/item.htm?spm=a230r.1.14.14.164217c5sq8AjP&id=562410358281&cm_id=140105335569ed55e27b&abbucket=8", // 商品链接
        goods_price: "0.00", //商品单价
        start_time: 2019324, // 商品开始时间
        goods_end_time: 1588127470, // 商品结束时间
        commission_than: "0", //佣金比例
        coupon_price: "0.00", //优惠卷金额
        coupon_collar_count: 0, // 优惠卷领取数量
        shop_deposit: "0.00", // 店铺名称
        goods_activity: 1,
        goods_class_name: "女装", // 分类名称
        goods_yx_img:
          "img.letuilm.com\\/2020\\/04\\/f3ccdd2020042809372664183.jpg", // 商品营销图
        source_material_url: "", //素材链接
        copywriting: "推广文案", // 推广文案
        friend_circle: "朋友圈文案", //朋友圈文案
        after_coupon_price: "50.00", //卷后单价
        status: 1,
        type: 1,
        sh_id: 2,
        coupon_num: 0, //优惠卷总量
        today_sq_num: 10, //今天申请数量
        week_sq_num: 12, // 本周申请数量
        day_sq_num: 20, // 本月申请数量
        today_success_num: 1, // 今天申请通过数量
        week_success_num: 5, // 本周申请通过数量
        day_success_num: 6, // 本月申请通过数量
        avg_goods_xl: "3.4", //本月平均销量
        avg_coupon_num: "400.9", //本月平均领卷数量
        phone: "17339612793", //账号
        team_name: "团队1", //团队名称
        team_img: "", //团队头像
        team_desc: "团队简介" //团队简介
      },
      {
        user_id: 5,
        avg_goods_xl: "3.0000",
        avg_coupon_num: "400.0000",
        phone: "17339612793",
        team_name: "团队1",
        team_img: "",
        team_desc: "团队简介",
        id: 6,
        goods_url: "https://detail.tmall.com/item.htm?id=527592226786",
        goods_img:
          "https://img.alicdn.com/imgextra/i2/62656128/TB2d5uwEkCWBuNjy0FaXXXUlXXa_!!62656128.jpg",
        coupon_url:
          "https://uland.taobao.com/quan/detail?sellerId=62656128&activityId=496e34a07338427dbb5964bba1bb179c",
        coupon_start_time: 1581177600,
        coupon_end_time: 1581868799,
        is_extension: 1,
        create_at: "2020-04-30 18:41:41",
        goods_price: "190",
        coupon_num: 5000,
        start_time: 1581177600,
        goods_end_time: 1581868799,
        commission_than: "20",
        coupon_price: "3.00",
        coupon_collar_count: 0,
        shop_deposit: "0.00",
        goods_activity: 1,
        goods_class_name: "美妆护肤",
        goods_yx_img:
          "/public/static/upload/img/20200209/6e857abd1ae48374f5f89f0fabb1599f.jpg",
        source_material_url: "",
        copywriting:
          "火烈鸟精致柔美眼线液硬头，一笔塑造浓郁造型，打造魅惑眼妆，放大你的双眼，防脱妆不易晕染！",
        friend_circle: null,
        after_coupon_price: "16.90",
        status: 2,
        type: 1,
        sh_id: 2,
        today_sq_num: 4, //今天申请数量
        week_sq_num: 5, // 本周申请数量
        day_sq_num: 6, // 本月申请数量
        today_success_num: 1, // 今天申请通过数量
        week_success_num: 2, // 本周申请通过数量
        day_success_num: 3 // 本月申请通过数量
      }
    ]
  });
};
const doPassGoods = () => {
  return builder({
    page: 1,
    max_page: 1,
    data: [
      {
        id: 6, //商品id
        goods_url: require("@/assets/images/goodsimg.jpg"),
        goods_activity: 1, //活动类型
        goods_class_name: "女装", //分类名
        goods_yx_img: require("@/assets/images/goodsimg.jpg"), //商品图片
        Source_material_url: "", //素材地址
        Copywriting: "推广文案", //推广文案
        Friend_circle: "朋友圈文案", //朋友圈文案
        after_coupon_price: "50.00", // 卷后单价
        status: 1, // 1=待审核
        type: 1, // 1=推广员申请推广商品 2=推广人员申请修改商品
        sh_id: 2 //审核数据的id
      },
      {
        id: 4,
        goods_url: require("@/assets/images/goodsimg.jpg"),
        goods_activity: 1,
        goods_class_name: "女装",
        goods_yx_img: require("@/assets/images/goodsimg.jpg"),
        Source_material_url: "",
        Copywriting: "推广文案",
        Friend_circle: "朋友圈文案",
        after_coupon_price: "50.00",
        status: 3,
        type: 1,
        sh_id: 3
      }
    ]
  });
};
const doRejectGoods = () => {
  return builder({
    code: 200,
    msg: "操作成功",
    data: []
  });
};
const userGetGoods = () => {
  return builder({
    page: 1, //当前第几页
    max_page: 1, // 最大页码
    data: [
      // 返回数据
      {
        id: 6, // 商品id
        goods_name: "", //商品名称
        goods_class_name: "女装", //分类名称
        goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
        shop_name: "", //店铺名称
        shop_deposit: "0.00", //店铺押金
        commission_than: "0", //拥挤比例
        goods_day_num: 0, //月销量
        coupon_collar_count: 0, //优惠卷领取数量
        goods_end_time: 1588127470, //商品到期时间
        goods_short_title: "" //商品短名称
      }
    ]
  });
};
const goodsTesting = () => {
  return builder({
    //可以上单返回数据 不可以上单 会返回对应的错误消息
    class_name: "女装", //分类名称
    class_id: 10005, //分类id
    data: {
      id: 7,
      goods_short_title: "", //商品短名称
      goods_end_time: 1588127470,
      goods_img: require("@/assets/images/goodsimg.jpg"), // 主图
      goods_yx_img: require("@/assets/images/goodsimg.jpg"), // 营销图
      marketing_video: require("@/assets/images/goodsimg.jpg"), //营销视频
      copywriting: "推广文案", //推广文案
      friend_circle: "朋友圈文案", //朋友圈文案
      goods_status: 1
    }
  });
};
const userAddGoods = () => {
  return builder({
    code: 200,
    msg: "添加成功",
    data: []
  });
};

Mock.mock(/\/local\/getUserInfo/, "post", getUserInfo);
Mock.mock(/\/local\/getUserGoods/, "post", getUserGoods);
Mock.mock(/\/local\/doEditInfo/, "post", doEditInfo);
Mock.mock(/\/local\/getAdminGoods/, "post", getAdminGoods);
Mock.mock(/\/local\/doPassGoods/, "post", doPassGoods);
Mock.mock(/\/local\/doRejectGoods/, "post", doRejectGoods);
Mock.mock(/\/local\/userGetGoods/, "post", userGetGoods);
Mock.mock(/\/local\/goodsTesting/, "post", goodsTesting);
Mock.mock(/\/local\/userAddGoods/, "post", userAddGoods);
